<template lang="pug">
  keep-alive
    kalix-table(bizKey="TrainingMessage" title='留言表' ref="kalixTable"
    v-bind:tableFields="tableFields"
    v-bind:targetURL="trainingMessageURL"
    v-bind:bizDialog="trainingMessageDialog"
    v-bind:btnList="trainingMessageBtnList"
    v-bind:buttonPermissionPrefix="buttonPermissionPrefix"
    v-bind:toolbarBtnList="toolbarBtnList"
    bizSearch="trainingMessageSearch")
</template>

<script type="text/ecmascript-6">
  import {trainingMessageURL, trainingMessageBtnPermissionPrefix} from '../../config.toml'
  import {trainingMessageConfigBtnList} from './config'
  import KalixTable from '../../../../../components/corelib/components/common/baseTable'

  export default {
    name: 'kalix-training-messages',
    components: {KalixTable},
    data() {
      return {
        trainingMessageURL: trainingMessageURL + '/getAllMessage',
        tableFields: [
          {prop: 'cname', label: '课程名称'},
          {prop: 'content', label: '评论内容'},
          {prop: 'score', label: '评分'}
        ],
        trainingMessageDialog: [
          {id: 'add', dialog: 'trainingMessageAdd'},
          {id: 'edit', dialog: 'trainingMessageEdit'},
          {id: 'view', dialog: 'trainingMessageView'}
        ],
        trainingMessageBtnList: trainingMessageConfigBtnList,
        toolbarBtnList: [
          {id: 'add', isShow: true, title: '添加', icon: 'icon-pinleizengjia', isPermission: true}
        ],
        buttonPermissionPrefix: trainingMessageBtnPermissionPrefix
      }
    }
  }
</script>

<style scoped lang="stylus">

</style>
